/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.Dialogs;

import General.CurrentData;
import com.sun.awt.AWTUtilities;
import other.Wizard;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JRootPane;

/**
 *
 * @author David
 */
public class SplashDialog extends JFrame
{

    /**
     *
     */
    public SplashDialog()
    {
        setUndecorated(true);
        try
        {
            AWTUtilities.setWindowOpacity(this, .98f);
        } catch (UnsupportedOperationException uoe)
        {
            CurrentData.getObserverDialog().printMessage("No transparency supported");
        }
        getRootPane().setWindowDecorationStyle(JRootPane.NONE);
        setSize(Toolkit.getDefaultToolkit().getScreenSize());
        setLocationRelativeTo(null);
        setVisible(true);
    }

    @Override
    public void paint(Graphics g)
    {
        g.setColor(new Color(62, 62, 62));
        g.fillRect(0, 0, getWidth(), getHeight());
        ImageIcon icon = new ImageIcon(Wizard.resizeImage(new ImageIcon("dat//img//other//logoBig.png").getImage(), getWidth(), getHeight(), true).getImage());
        g.drawImage(icon.getImage(), getWidth() / 2 - icon.getIconWidth() / 2, getHeight() / 2 - icon.getIconHeight() / 2, rootPane);
    }
}
